package ca.etsmtl.log730.projet.model;

import java.io.Serializable;

import java.io.Serializable;

public class LockInfo implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3764128196950361160L;
	private Boolean writable = true;
	private Boolean readable = true;
	
	public Boolean isWritable() {
		return writable;
	}

	public Boolean isReadable() {
		return readable;
	}
	
	public static LockInfo get(boolean w, boolean r) {
		LockInfo n = new LockInfo();
		n.writable = w;
		n.readable = r;
		return n;
	}
	
	public String toString() {
		return (readable ? "R": "-") + (writable ? "W": "-");
	}
}
